package com.harusoft.interlock;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class NetStateActivity extends Activity implements OnClickListener{
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.net_state_check);
		Button btn1=(Button)findViewById(R.id.net_btn1);
		Button btn2=(Button)findViewById(R.id.net_btn2);
		btn1.setOnClickListener(this);
		btn2.setOnClickListener(this);
	}
	@Override
	public void onClick(View v) {
		Intent intent=new Intent();
		if(v.getId()==R.id.net_btn1) intent.putExtra("state", true);
		else intent.putExtra("state", false);
		setResult(RESULT_OK, intent);
		finish();
	}
	@Override
	public void onBackPressed() {
		Intent intent=new Intent();
		intent.putExtra("state", false);
		setResult(RESULT_OK,intent);
		super.onBackPressed();
	}
}
